home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / as / dist / a.out.h.notused < prev    next >
Encoding:
Text File  |  1989-03-01  |  2.5 KB  |  85 lines

  1. /* This file describes the a.out file format
  2.    Copyright (C) 1987 Free Software Foundation, Inc.
  3.  
  4. This file is part of GAS, the GNU Assembler.
  5.  
  6. GAS is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GAS is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GAS; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* JF I'm not sure where this file came from.  I put the permit.text message in
  21.    it anyway.  This file came to me as part of the original VAX assembler */
  22.  
  23. #define OMAGIC 0407
  24. #define NMAGIC 0410
  25. #define ZMAGIC 0413
  26.  
  27. struct exec {
  28.     long    a_magic;            /* number identifies as .o file and gives type of such. */
  29.     unsigned a_text;        /* length of text, in bytes */
  30.     unsigned a_data;        /* length of data, in bytes */
  31.     unsigned a_bss;        /* length of uninitialized data area for file, in bytes */
  32.     unsigned a_syms;        /* length of symbol table data in file, in bytes */
  33.     unsigned a_entry;        /* start address */
  34.     unsigned a_trsize;        /* length of relocation info for text, in bytes */
  35.     unsigned a_drsize;        /* length of relocation info for data, in bytes */
  36. };
  37.  
  38. #define N_BADMAG(x) \
  39.  (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
  40.  
  41. #define N_TXTOFF(x) \
  42.  ((x).a_magic == ZMAGIC ? 1024 : sizeof(struct exec))
  43.  
  44. #define N_SYMOFF(x) \
  45.  (N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize)
  46.  
  47. #define N_STROFF(x) \
  48.  (N_SYMOFF(x) + (x).a_syms)
  49.  
  50. struct nlist {
  51.     union {
  52.         char    *n_name;
  53.         struct nlist *n_next;
  54.         long    n_strx;
  55.     } n_un;
  56.     char    n_type;
  57.     char    n_other;
  58.     short    n_desc;
  59.     unsigned n_value;
  60. };
  61.  
  62. #define N_UNDF    0
  63. #define N_ABS    2
  64. #define N_TEXT    4
  65. #define N_DATA    6
  66. #define N_BSS    8
  67. #define N_FN    31        /* JF: Someone claims this should be 31 instead of
  68.                15.  I just inherited this file; I didn't write
  69.                it.  Who is right? */
  70.  
  71. #define N_EXT 1
  72. #define N_TYPE 036
  73. #define N_STAB 0340
  74.  
  75. struct relocation_info {
  76.     int     r_address;
  77.     unsigned r_symbolnum:24,
  78.          r_pcrel:1,
  79.          r_length:2,
  80.          r_extern:1,
  81.          r_bsr:1, /* OVE: used on ns32k based systems, if you want */
  82.          r_disp:1, /* OVE: used on ns32k based systems, if you want */
  83.          nuthin:2;
  84. };
  85.